package trogiup;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.Vector;


import trangchu.UtilDelegate;


public class SelectData {

	public Vector<DSJGetLienHe> getList(){
		
		Vector<DSJGetLienHe> getLienHe = new Vector<DSJGetLienHe>();
		Connection con =UtilDelegate.getConnection();
		try {
			  Statement st = con.createStatement();
			  ResultSet  traVe = st.executeQuery("Select * from LienHe");
			  while (traVe.next()) { 
					String tenCongTy = traVe.getString("TenCongTy");
					String diachi = traVe.getString("DiaChi");
					String dienthoai = traVe.getString("DienThoai");
					String fax = traVe.getString("Fax");
					String email = traVe.getString("Email");
					String web = traVe.getString("Website");
					String linhvuc = traVe.getString("LinhVuc");
					String nganhnghe = traVe.getString("NganhNghe");
					String masothue = traVe.getString("MaSoThue");
					String nguoilienhe = traVe.getString("NguoiLienHe");
					String noidung = traVe.getString("NoiDung");
					
					DSJGetLienHe user = new DSJGetLienHe();
					user.setTenCongTy(tenCongTy);
					user.setDiachi(diachi);
					user.setDienthoai(dienthoai);
					user.setFax(fax);
					user.setEmail(email);
					user.setWeb(web);
					user.setLinhvuc(linhvuc);
					user.setNganhnghe(nganhnghe);
					user.setMasothue(masothue);
					user.setNguoilienhe(nguoilienhe);
					user.setNoidung(noidung);
					
					
					getLienHe.add(user);
				}
		} catch (Exception e) {
		}finally{
			UtilDelegate.closeConnection(con);
		}
		return getLienHe;
		
	}
	
}
